import home from "@/views/home/index.vue";
import system from "@/views/system/staff.vue"
import tenantdepartment from "@/views/system/tenant_department.vue"
import operationlogs from "@/views/system/operation-logs.vue"
import Personnel from '@/views/system/Personnel.vue'
import Menu from '@/views/system/menu.vue'

import { getList } from '@/api/menu.js';
console.log(11111111111)
let userInfo = localStorage.getItem("user");
if (userInfo) {
    const res = await getList({});
    if (res.code === 200) {
        console.log(res.data)
    } 
}

export const constantRoutes = [
    {
        path: "/home",
        name: "首页",
        component: home,
    },
    {
        path: '/system/tenantdepartment',
        name: '系统维护',
        children: [
            {
                path: '/system/tenantdepartment',
                name: '组织架构',
                component: tenantdepartment,
            },
            {
                path: '/system',
                name: '角色管理',
                component: system,
            },
            {
                path: '/system/menu',
                name: '菜单管理',
                component: Menu,
            },
            {
                path: '/system/Personnel',
                name: '人员信息',
                component: Personnel,
            },
            {
                path: '/system/operation-logs',
                name: '登录日志',
                component: operationlogs,
            }
        ]
    }
]